<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/commons/taglibs.jsp" %>

<script>

	using('dialog', function(){
		$('#activityInfosDialog').dialog({

		});
		$('#treeDialog').dialog({

		});
	});
	using('tabs', function(){

	});
	function useTreeNode(workOrderSort,workOrderSortDdValue){
		$("#workOrderSort").val(workOrderSort);
		$("#workOrderSortDdValue").val(workOrderSortDdValue);
		//alert(workOrderSort);
		$('#treeDialog').dialog('close');
	}
	function showActivityInfosDialog(){
		$('#activityInfosDialog').dialog('open');
	}
	function showTreeDialog(){
		$('#treeDialog').dialog('open');
	}showDiffDialog
	function showDiffDialog(){
		launch();
		$('#diffDialog').dialog('open');
	}

		function backProcess(){
			$("#isPass").val("false");
			$("#isApprove").val("false");
			$("#TszbProcessInfoForm").submit();
		}

		function applyWorkOrderDelay(){
			$("#TszbProcessInfoForm").attr("action", "${ctx}/pages/TszbProcessInfo/applyWorkOrderDelay.do");
			$("#TszbProcessInfoForm").submit();
		}

		function approveWorkOrderDelay(){
			$("#TszbProcessInfoForm").attr("action", "${ctx}/pages/TszbProcessInfo/approveWorkOrderDelay.do");
			$("#TszbProcessInfoForm").submit();
		}

		function reject(){
			$.messager.confirm('系统提示', '确定执行[工单报废]操作？', function(r){
				if (r){
					$("#isReject").val("1");
					$("#TszbProcessInfoForm").submit();
				}
			});

		}
		//内容痕迹对比
		function launch() {
			var dmp = new diff_match_patch();
		  var text1 = document.getElementById('text1').value;
		  var text2 = document.getElementById('text2').value;

		  var d = dmp.diff_main(text1, text2);

		  var ds = dmp.diff_prettyHtml(d);
		  document.getElementById('outputdiv').innerHTML = ds ;
		}

		new Validation(document.forms[0],{onSubmit:true,onFormValidate : function(result,form) {
			//$('#tabs').tabs('select','质控评分');
			var finalResult = result;

			//alert($('#gradeTermScores').numberspinner('isValid'));

			//在这里添加自定义验证

			return disableSubmit(finalResult,'submitButton');
		}});
	</script>